package com.xqb.modules.domain.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.*;
import lombok.experimental.Tolerate;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 退款申请
 *
 * @author 2092466583
 * @TableName ord_refund_apply
 */
@TableName(value = "ord_refund_apply")
@Builder
@Data
public class OrdRefundApply implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Tolerate
    public OrdRefundApply() {

    }



    /**
     * 退款id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 订单明细id
     */
    private Long orderDetailId;

    /**
     * 订单id
     */
    private Long orderId;

    /**
     * 流水支付单号
     */
    private Long payOrderNo;

    /**
     * 流水退款单号
     */
    private Long refundOrderNo;

    /**
     * 订单所属用户id
     */
    private Long userId;

    /**
     * 退款金额
     */
    private BigDecimal refundAmount;

    /**
     * 退款状态，1：待审批，2：取消退款，3：同意退款，4：拒绝退款，5：退款成功，6：退款失败
     */
    private Integer status;

    /**
     * 申请退款原因
     */
    private String refundReason;

    /**
     * 退款状态描述
     */
    private String message;

    /**
     * 审批人id
     */
    private Long approver;

    /**
     * 审批意见
     */
    private String approveOpinion;

    /**
     * 审批备注
     */
    private String remark;

    /**
     * 退款失败原因
     */
    private String failedReason;

    /**
     * 退款问题说明
     */
    private String questionDesc;

    /**
     * 退款渠道
     */
    private String refundChannel;

    /**
     * 创建退款申请时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 审批时间
     */
    private Date approveTime;

    /**
     * 退款完成时间（成功或失败）
     */
    private Date finishTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    /**
     * 机构id
     */
    private Long insId;


//    @Override
//    public boolean equals(Object that) {
//        if (this == that) {
//            return true;
//        }
//        if (that == null) {
//            return false;
//        }
//        if (getClass() != that.getClass()) {
//            return false;
//        }
//        OrdRefundApply other = (OrdRefundApply) that;
//        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
//                && (this.getOrderDetailId() == null ? other.getOrderDetailId() == null : this.getOrderDetailId().equals(other.getOrderDetailId()))
//                && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
//                && (this.getPayOrderNo() == null ? other.getPayOrderNo() == null : this.getPayOrderNo().equals(other.getPayOrderNo()))
//                && (this.getRefundOrderNo() == null ? other.getRefundOrderNo() == null : this.getRefundOrderNo().equals(other.getRefundOrderNo()))
//                && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
//                && (this.getRefundAmount() == null ? other.getRefundAmount() == null : this.getRefundAmount().equals(other.getRefundAmount()))
//                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
//                && (this.getRefundReason() == null ? other.getRefundReason() == null : this.getRefundReason().equals(other.getRefundReason()))
//                && (this.getMessage() == null ? other.getMessage() == null : this.getMessage().equals(other.getMessage()))
//                && (this.getApprover() == null ? other.getApprover() == null : this.getApprover().equals(other.getApprover()))
//                && (this.getApproveOpinion() == null ? other.getApproveOpinion() == null : this.getApproveOpinion().equals(other.getApproveOpinion()))
//                && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
//                && (this.getFailedReason() == null ? other.getFailedReason() == null : this.getFailedReason().equals(other.getFailedReason()))
//                && (this.getQuestionDesc() == null ? other.getQuestionDesc() == null : this.getQuestionDesc().equals(other.getQuestionDesc()))
//                && (this.getRefundChannel() == null ? other.getRefundChannel() == null : this.getRefundChannel().equals(other.getRefundChannel()))
//                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
//                && (this.getApproveTime() == null ? other.getApproveTime() == null : this.getApproveTime().equals(other.getApproveTime()))
//                && (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime()))
//                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
//                && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
//                && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
//                && (this.getInsId() == null ? other.getInsId() == null : this.getInsId().equals(other.getInsId()));
//    }
//
//    @Override
//    public int hashCode() {
//        final int prime = 31;
//        int result = 1;
//        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
//        result = prime * result + ((getOrderDetailId() == null) ? 0 : getOrderDetailId().hashCode());
//        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
//        result = prime * result + ((getPayOrderNo() == null) ? 0 : getPayOrderNo().hashCode());
//        result = prime * result + ((getRefundOrderNo() == null) ? 0 : getRefundOrderNo().hashCode());
//        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
//        result = prime * result + ((getRefundAmount() == null) ? 0 : getRefundAmount().hashCode());
//        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
//        result = prime * result + ((getRefundReason() == null) ? 0 : getRefundReason().hashCode());
//        result = prime * result + ((getMessage() == null) ? 0 : getMessage().hashCode());
//        result = prime * result + ((getApprover() == null) ? 0 : getApprover().hashCode());
//        result = prime * result + ((getApproveOpinion() == null) ? 0 : getApproveOpinion().hashCode());
//        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
//        result = prime * result + ((getFailedReason() == null) ? 0 : getFailedReason().hashCode());
//        result = prime * result + ((getQuestionDesc() == null) ? 0 : getQuestionDesc().hashCode());
//        result = prime * result + ((getRefundChannel() == null) ? 0 : getRefundChannel().hashCode());
//        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
//        result = prime * result + ((getApproveTime() == null) ? 0 : getApproveTime().hashCode());
//        result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode());
//        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
//        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
//        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
//        result = prime * result + ((getInsId() == null) ? 0 : getInsId().hashCode());
//        return result;
//    }
//
//    @Override
//    public String toString() {
//        StringBuilder sb = new StringBuilder();
//        sb.append(getClass().getSimpleName());
//        sb.append(" [");
//        sb.append("Hash = ").append(hashCode());
//        sb.append(", id=").append(id);
//        sb.append(", orderDetailId=").append(orderDetailId);
//        sb.append(", orderId=").append(orderId);
//        sb.append(", payOrderNo=").append(payOrderNo);
//        sb.append(", refundOrderNo=").append(refundOrderNo);
//        sb.append(", userId=").append(userId);
//        sb.append(", refundAmount=").append(refundAmount);
//        sb.append(", status=").append(status);
//        sb.append(", refundReason=").append(refundReason);
//        sb.append(", message=").append(message);
//        sb.append(", approver=").append(approver);
//        sb.append(", approveOpinion=").append(approveOpinion);
//        sb.append(", remark=").append(remark);
//        sb.append(", failedReason=").append(failedReason);
//        sb.append(", questionDesc=").append(questionDesc);
//        sb.append(", refundChannel=").append(refundChannel);
//        sb.append(", createTime=").append(createTime);
//        sb.append(", approveTime=").append(approveTime);
//        sb.append(", finishTime=").append(finishTime);
//        sb.append(", updateTime=").append(updateTime);
//        sb.append(", createBy=").append(createBy);
//        sb.append(", updateBy=").append(updateBy);
//        sb.append(", insId=").append(insId);
//        sb.append(", serialVersionUID=").append(serialVersionUID);
//        sb.append("]");
//        return sb.toString();
//    }
}